package com.pixiv.servlet.PixivServlet;

import com.pixiv.tools.SendPrintWriterPacket;
import com.pixiv.user.User;

import javax.servlet.ServletException;
import javax.servlet.annotation.WebServlet;
import javax.servlet.http.HttpServlet;
import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse;
import javax.servlet.http.HttpSession;
import java.io.IOException;
import java.lang.reflect.Method;

@WebServlet("/PixivUserIconServlet")
public class PixivUserIconServlet extends HttpServlet {
    @Override
    protected void service(HttpServletRequest req, HttpServletResponse resp)
            throws ServletException, IOException {

        req.setCharacterEncoding("utf-8");
        String type = req.getParameter("appType");
        try {
            Class<?> c = this.getClass();
            Method me = c.getMethod("Service_" + type, HttpServletRequest.class, HttpServletResponse.class);
            me.invoke(this, req, resp);
        } catch (Exception e) {
            e.printStackTrace();
        }
    }
    //发送用户头像包
    public void Service_getUserIcon(HttpServletRequest req, HttpServletResponse resp)
    {
        resp.setContentType("application/json;charset=utf-8");
    }
}
